1. /* sdfexpac.cpp by K.Tsuru */
  2. // function ID 3317 DRADIX
  3. /**************************************************************************
  4. SDouble class
  5. It provides a function which checks the argument x is proper or not, i.e.
  6. it returns whether the exponential function exp(x) occurs an overflow/underflow
  7. error or not by an integer value.
  8. From the condition "exp(x) < DRADIX^DRADIX_EXP_MAX" the range of 'x' must be
  9. within
  10. |x| < DFIGURES*log(10)*DRADIX_EXP_MAX = 301759.17...
  11. ***************************************************************************/
  12. #ifndef SN_H
  13. #include "sn.h"
  14. #endif
  15. static const double xMax = (double)DFIGURES * M_LN10 * (double)DRADIX_EXP_MAX;
  16. // = 301759.17...
  17. SNManager::SNErrorFlag ExpArgCheck(const SDouble& x, int funcID) {
  18. double iX = doubleD(x, 0);
  19. SNManager::SNErrorFlag err = x.SNError();
  20. if( fabs(iX) < xMax ) return x.NO_ERR;
  21. err = (x.Sign() > 0) ? x.OVERFLOW_ERR : x.UNDERFLOW_ERR;
  22. if (funcID > 0) {
  23. x.Puts(5, 20);
  24. x.SetError(err, " exp(x) \"x\" has above value.", funcID);
  25. }
  26. return err;
  27. }

sdfexpac.cpp : last modifiled at 2007/10/01 15:45:40(1,079 bytes)
created at 2017/10/07 10:22:50
The creation time of this html file is 2017/10/07 11:29:39 (Sat Oct 07 11:29:39 2017).